package com.atserver.listener;

import com.atserver.windows.CoordinateWindow;
import com.atserver.windows.ScannerWindow;

import javax.swing.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

/**
 * @program: atserver
 * @Description: 焦点菜单按键
 * @author: Mr.Cheng
 * @date: 2022/6/7 2:31 下午
 */
public class FocusMenuActionListener implements ActionListener {

    private ScannerWindow scannerWindow;

    public FocusMenuActionListener(ScannerWindow scannerWindow) {
        this.scannerWindow = scannerWindow;
    }

    public FocusMenuActionListener() {
    }

    /**
     * Invoked when an action occurs.
     *
     * @param e
     */
    @Override
    public void actionPerformed(ActionEvent e) {
        SwingUtilities.invokeLater(new Runnable() {
            @Override
            public void run() {
                CoordinateWindow coordinateWindow = new CoordinateWindow("焦点获取",scannerWindow);
                coordinateWindow.setVisible(true);
            }
        });
    }
}
